package com.atguigu.ssm.controller;

import com.atguigu.ssm.pojo.Emp;
import com.atguigu.ssm.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * @author chenyifan
 * @create 2022-08-04 10:17
 */
@Controller
public class EmpController {


    @Autowired
    private EmpService empService;

    @RequestMapping(value = "/emps",method = RequestMethod.GET)
    public String getAllEmp(Model model){
        List<Emp> emps = empService.getAllEmp();
        model.addAttribute("emps",emps);
        return "emp_list";
    }

    //33333333333333333333
}
